local zixian = fk.CreateSkill({
    name = "sj3__zixian",
    tags = {Skill.Compulsory},
})
  
Fk:loadTranslationTable{
  ["sj3__zixian"] = "辎先",
  [":sj3__zixian"] = "<b>锁定技</b>，你的坐骑栏均改为宝物栏。开局时你不分发初始手牌，改为使用三张【木牛流马】且每张随机扣置牌堆中每种类型牌各一张。",

  ["$sj3__zixian1"] = "",
  ["$sj3__zixian2"] = "",
}

  zixian:addEffect(fk.DrawInitialCards, {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
      return player:hasSkill(zixian.name) and target == player
    end,
    on_use = function(self, event, target, player, data)
      data.num = 0
      local room = player.room
      for i = 1, 3, 1 do
        local muma = room:printCard("role__wooden_ox_"..i, Card.Diamond, 5)
        room:useCard{
          from = player,
          tos = {player},
          card = muma,
        }
        for _, t in ipairs({"basic", "trick", "equip"}) do
          local cs = room:getCardsFromPileByRule(".|.|.|.|.|"..t.."|.")
          if #cs > 0 then
            player:addToPile("$role_carriage_"..i, cs, false, zixian.name)
          end
        end
      end
    end,
  })

  zixian.onAcquire = function (self, player, is_start)
    local room = player.room
    local all_choices = {"DefensiveRideSlot", "OffensiveRideSlot"}
    local subtypes = {Card.SubtypeDefensiveRide, Card.SubtypeOffensiveRide}
    for i = 1, 2, 1 do
      if #player:getAvailableEquipSlots(subtypes[i]) > 0 then
        room:abortPlayerArea(player, all_choices[i])
        room:addPlayerEquipSlots(player, { Player.TreasureSlot })
      end
    end
  end
  
  zixian.onLose = function (self, player, is_death)
    local room = player.room
    local all_choices = {"DefensiveRideSlot", "OffensiveRideSlot"}
    local subtypes = {Card.SubtypeDefensiveRide, Card.SubtypeOffensiveRide}
    for i = 1, 2, 1 do
      if #player:getAvailableEquipSlots(subtypes[i]) == 0 then
        room:resumePlayerArea(player, all_choices[i])
      end
      room:removePlayerEquipSlots(player, { Player.TreasureSlot })
    end
  end

  return zixian